package cn.com.hbhgkj.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import cn.com.hbhgkj.common.DaoException;
import cn.com.hbhgkj.common.Pagination;

public interface GenericDao<T extends Serializable, PK extends Serializable> {

	public T get(PK id) throws DaoException;

	public void update(T entity) throws DaoException;

	public void save(T entity) throws DaoException;

	public void saveOrUpdate(T entity) throws DaoException;

	public void saveOrUpdateAll(Collection<T> entities) throws DaoException;

	public void delete(T entity) throws DaoException;

	public int getTotalCount(DetachedCriteria criteria) throws DaoException;
	
	public List<T> getAll(Pagination pagination) throws DaoException;

}
